﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeBehind="mylist.aspx.cs" Inherits="dzs.Web.Admin.mp.mylist" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script language="javascript" src="/js/CheckBox.js" type="text/javascript"></script>
    <link href="../lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <link href="../lib/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />    
    <script src="../lib/ligerUI/js/core/base.js" type="text/javascript"></script>
    <script src="../lib/ligerUI/js/plugins/ligerDrag.js" type="text/javascript"></script>
    <script src="../lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
    <script src="../lib/ligerUI/js/plugins/ligerResizable.js" type="text/javascript"></script>
    <script src="../../Scripts/mybase.js"></script>
    <script src="../../js/CheckBox.js"></script>
     <link href="../../jquery-ui.min.css" rel="stylesheet" />    
    <script src="../../js/jquery-ui.min.js"></script>
     <script type="text/javascript">
         $(function () {
             $("#<%# txtKeyword2.ClientID%>").autocomplete({
                 minLength: 2, // 设置搜索的关键字最小长度// 设置自动完成列表的函数，函数包括两个参数，requset和response      
                 source: function (request, response) {
                     $.ajax({
                         type: "POST",          // 通过request.term可以获得文本框内容   
                         url: "../../Handler.ashx?keyword=" + request.term,
                         contentType: "application/json; charset=gb2312",
                         dataType: "json",
                         success: function (data) {
                             // jQuery.map(array, callback) :将一个数组中的元素转换到另一个数组中。
                             //  下面就是把数组["value1", "value2",...]转换为[{value:"value1"}, {value:"value2"},...]                 
                             response($.map(data, function (item) {
                                 return { value: item };
                             }));
                         },
                         error: function () {
                             alert("ajax请求失败");
                         }
                     });
                 }
             });
         });
         </script>
    <script type="text/javascript">

        var win1;
        function f_open(id,sy) {
            var ul = 'Add.aspx?id=' + id+'&sy='+sy;
            
                win1 = $.ligerDialog.open({ url: ul, height: 350, isResize: true, width: 500, showMax: false, showToggle:false, modal: true, isResize: true, slide: true, title: '操作', onClosed: function () { alert('OK'); } });
        }
        function update() {
            $("#<%= btnSearch.ClientID %>").click();
        }
        function checksel() {
            if ($("#<%= gridView.ClientID %> tr :checkbox:checked").length > 0)
                return true;
            else
            { alert('没有选择任何行！'); return false; }

        }
    </script>
    <style type="text/css">
        .auto-style1 {
            width: 793px;
        }
         .b { border-collapse:separate;
            border-spacing:1px;
            margin:5px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
     <table style="width: 100%;" cellpadding="2" cellspacing="1" class="border">
                <tr>
                    <td style="width: 18px" align="right" >
                                             
                        
                    &nbsp;</td>
                    <td class="auto-style1"> 
                        <b>项目名：</b>  <asp:TextBox ID="txtKeyword2" runat="server" Width="150px"></asp:TextBox>
                         
                    <b>物料描述：</b><asp:TextBox ID="txtKeyword" runat="server" Width="91px"></asp:TextBox>
                    &nbsp;
                        <b>供应商：</b>  <asp:TextBox ID="txtKeyword3" runat="server" Width="84px"></asp:TextBox>
                        
                    <asp:Button ID="btnSearch" runat="server" Text="查询"  OnClick="btnSearch_Click" >
                    </asp:Button>                    
                        
                    </td>
                    <td >
                        <asp:Label ID="lblmsg" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
                    </td>
                </tr>
            </table>
            <!--Search end-->
            <br />

            <asp:GridView ID="gridView" runat="server" AllowPaging="True" Width="98%" BorderWidth="0px" CellPadding="0" CellSpacing="1" CssClass="gv b" GridLines="None"  OnPageIndexChanging ="gridView_PageIndexChanging"
                     DataKeyNames="monthSupplyPlanId" 
                    AutoGenerateColumns="False"  RowStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" PageSize="15">
                    <Columns>
                            <asp:TemplateField HeaderText="配送">
                            <ItemTemplate>
                                <img alt="" class="auto-style2" src="../images/accessories.gif" onclick="f_open(<%# Eval("monthSupplyPlanId") %>,<%# Eval("synum") %>)"/>
                            </ItemTemplate>
                        </asp:TemplateField>
		<asp:BoundField DataField="proid" HeaderText="项目编号" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="projectName" HeaderText="项目名"  ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="material" HeaderText="物料描述"  ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="thisMonthCount" HeaderText="本月供应量" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="nums" HeaderText="配送量" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
                            
		<asp:BoundField DataField="synum" HeaderText="剩余量" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
                            
                            <asp:BoundField DataField="sname" HeaderText="供应商" />
                            
                            <asp:HyperLinkField HeaderText="详细" ControlStyle-Width="50" DataNavigateUrlFields="monthSupplyPlanId" DataNavigateUrlFormatString="../../monthSupplayPlan/Show.aspx?id={0}"
                                Text="详细"  >
<ControlStyle Width="50px"></ControlStyle>
                        </asp:HyperLinkField>
                        </Columns>

<HeaderStyle HorizontalAlign="Center"></HeaderStyle>

                    <PagerStyle CssClass="mypager" />

<RowStyle HorizontalAlign="Center" VerticalAlign="Middle"></RowStyle>
                </asp:GridView>
               <table border="0" cellpadding="0" cellspacing="1" style="width: 100%;">
                <tr>
                    <td style="width: 1px;">                        
                    </td>
                    <td align="left">
                        &nbsp;</td>
                </tr>
            </table>
</asp:Content>
